package com.sunny.shop.api.v1;

import com.sunny.shop.core.interceptors.ScopeLevel;
import com.sunny.shop.dto.SignDTO;
import com.sunny.shop.exception.httpe.Success;
import com.sunny.shop.service.SignServiceImpl;
import com.sunny.shop.vo.SignVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/sign")
public class SignController {
    @Autowired
    private SignServiceImpl signService;

    /**
     * 签到操作
     */
    @ScopeLevel()
    @PostMapping("")
    public void sign(){
        Integer sign = signService.sign();
        throw new Success(60001);
    }

    /**
     * 获取签到记录
     * @return
     */
    @ScopeLevel()
    @GetMapping("")
    public SignVO getSignList(){
        SignVO signList = signService.getSignList();
        return signList;
    }
}
